package com.solo.service.impl;

import com.solo.dao.UserDAO;
import com.solo.entity.User;
import com.solo.service.UserService;
import java.util.List;

public class UserServiceImpl implements UserService {

    private UserDAO userDAO;
    public UserServiceImpl() {
        userDAO = new UserDAO();
    }

    @Override
    public User selectLoginUser(String username, String password) {
        return userDAO.selectLoginUser(username,password);
    }

    @Override
    public boolean addUser(User user)  {
        boolean a = userDAO.addUser(user);
        return a;
    }

    @Override
    public boolean deleteUser(User user) {
        boolean a = userDAO.deleteUser(user);
        return a;
    }

    @Override
    public boolean updateUser(User user)  {
        boolean a = userDAO.updateUser(user);
        return a;
    }

    @Override
    public List<User> selectAllUser() {
        List<User> listUser = userDAO.selectAllUser();
        return listUser;
    }

    @Override
    public User selectUserById(Long id) {
        return userDAO.selectUserById(id);
    }
}
